package Game;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.ArrayList;

import org.junit.*;

import cardCollections.Hand;
import cardCollections.Shoe;

public class GameTest {
	private GameClass testGame;

	@Before
	public void setUp() throws Exception {
		Shoe testShoe = new Shoe();
		ArrayList<Hand> testHands = new ArrayList<Hand>();
		testHands.add(new Hand());
		Dealer testDealer = new Dealer();
		testGame = new GameClass(testShoe, testHands, testDealer, 1);

	}

	@Test
	public void ConstructorNotNull() {
		assertTrue(testGame != null);
	}

	@Test
	public void testSplit() throws IOException {

		testGame.hit(0);
		testGame.hit(0);
		testGame.splitHand(0);

		assertEquals(2, testGame.getHandSize());
	}

	@Test
	public void testCheckWin() {
		assertEquals(testGame.checkWin(0), testGame.checkWin(0));

	}

	@Test
	public void testDealer() {
		Dealer d = new Dealer();
		assertEquals(d.dealerHit(), d.dealerHit());
	}

}
